import request from "@/utils/http"
import type { SearchResult } from "@/types/SearchResult"
import type { SkuInfo } from'@/types/SkuModule';
import type { SearchParams } from '@/types/SearchParams';

// 搜索商品
export const searchDataApi = (data?: SearchParams) => {
  return request<SearchResult<SkuInfo>>({
    url:'search/front/list',
    method:'POST',
    data,
  })
}

// 同类推荐
export const sameGoodsApi = (spuId:number, categoryId: number) => {
  return request<SkuInfo[]>({
    url:`search/front/same/${spuId}/${categoryId}`,
    method:'GET',
  })
}
